package com.dxy.app.act_widget;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.Toast;
import com.dxy.app.R;
import com.dxy.app.widget.draw.GesturePasswordListener;
import com.dxy.app.widget.draw.GesturePasswordView;

/**
 * Created by dell on 2017/8/7.
 */

public class GesturePasswordActivity extends Activity {

  private GesturePasswordView gesture;

  @Override protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gesture_password);
    gesture = (GesturePasswordView) findViewById(R.id.gpv);

    gesture.setGestureListener(new GesturePasswordListener() {
      @Override public void getGesturePassword(String str) {
        Toast.makeText(GesturePasswordActivity.this, "当前密码："+str, Toast.LENGTH_SHORT).show();
      }

      @Override public void uninvalidatePassword(int count) {
        Toast.makeText(GesturePasswordActivity.this, "无效的密码,必须大于"+count+"个点!!!", Toast.LENGTH_SHORT).show();
      }
    });
  }
}
